import Vue from 'vue'
import VueRouter from 'vue-router'
// import HomeView from '../views/HomeView.vue'
import home from '../views/home/index.vue'
import index from '../views/HomeView.vue'

import shijuan from '../views/ShijuanView.vue'
import shiping from '../views/ShipingView.vue'
import xunlian from '../views/XunlianView.vue'
import jilu from '../views/JiluView.vue'
import cuoti from '../views/CuotiView.vue'


// 避免重复点击路由报错
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/index',
  },
  {
    path: '/home',
    name: 'home',
    component: home,
    
    
    },
    
    {
      path: '/shijuan',
      name: 'shijuan',
      component: shijuan
    },
    {
      path: '/shiping',
      name: 'shiping',
      component: shiping
    },
    {
      path: '/xunlian',
      name: 'xunlian',
      component: xunlian
    },
    {
      path: '/jilu',
      name: 'jilu',
      component: jilu
    },
    {
      path: '/cuoti',
      name: 'cuoti',
      component: cuoti
    },
    {
      path: '/index',
      name: 'index',
      component: index
    },
  
    
  
 
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
